<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
	    <#assign base=request.contextPath  />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<title>login</title>
<link rel="stylesheet" type="text/css" href="${base}/admin/MyStatic/css/login/normalize.css" />
<link rel="stylesheet" type="text/css" href="${base}/admin/MyStatic/css/login/demo.css" />
<link rel="stylesheet" type="text/css" href="${base}/admin/MyStatic/css/cloud.css" />
    <link rel="stylesheet" href="${base}/admin/MyStatic/frame/layui/css/layui.css">
    <script type="text/javascript" src="${base}/admin/MyStatic/frame/layui/layui.all.js"></script>
<!--必要样式-->
<link rel="stylesheet" type="text/css" href="${base}/admin/MyStatic/css/login/component.css" />
<script src="${base}/admin/MyStatic/js/html5.js"></script>
<script src="${base}/admin/MyStatic/js/jquery.min.js"></script>
<script src="${base}/admin/MyStatic/js/jquery.blockUI.js"></script>
    <script src="${base}/admin/MyStatic/js/cloud.js"  ></script>
</head>
<body>
<script>
    //控制跳出ifream框架
    if (window != top)
        top.location.href = location.href;
</script>
		<div class="container demo-1">
			<div class="content">
				<div id="large-header" class="large-header">
					<canvas id="demo-canvas"></canvas>
					<div class="logo_box">
						<h3>欢迎你</h3>

							<div class="input_outer">
								<span class="u_user"></span>
								<input id="userName" class="text" style="color: #FFFFFF !important" type="text" value="admin">
							</div>
							<div class="input_outer">
								<span class="us_uer"></span>
								<input id="passWord" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"  type="password" value="123456">
							</div>
							<div class="mb2"><a onclick="login()" class="act-but submit" href="javascript:;" style="color: #FFFFFF" data-loading="正在验证登录，请稍后...">登录</a></div>

					</div>
				</div>
			</div>
		</div><!-- /container -->
		<script src="${base}/admin/MyStatic/js/TweenLite.min.js"></script>
		<script src="${base}/admin/MyStatic/js/EasePack.min.js"></script>
		<script src="${base}/admin/MyStatic/js/rAF.js"></script>
		<script src="${base}/admin/MyStatic/js/demo-1.js"></script>
        <script>
			function login(){
			    if($("#userName").val()==""||$("#userName").val()==null){
                    layer.msg("请正确输入账户", {icon: 5})
					return;
				}
			    if($("#passWord").val()==""||$("#passWord").val()==null){
                    layer.msg("请正确输入密码", {icon: 5})
                    return;
				}

                $.modal.loading("请稍后...");
                setTimeout(function () {
                    $.ajax({
                        type: "get",
                        url:  "${base}/admin/user/login",
						async:false,
                        data: {
                            "userName": $("#userName").val(),
                            "passWord": $("#passWord").val()
                        },
                        success: function(data) {
                            if(data.code===100){
                                layer.msg("口令错误", {icon: 5})
                            }
                            if(data.code===0){
                                window.location.href="${base}/admin/user/index.html"
                            }
                            $.modal.closeLoading();
                        },
                        error:function (XMLHttpRequest, textStatus, errorThrown) {
                            $.modal.closeLoading();
                        }
                    });
                },500)

			}
		</script>
	</body>
</html>